//
//  BaseViewController.m
//  Nurse
//
//  Created by Sunny on 13-12-16.
//  Copyright (c) 2013年 RainSets. All rights reserved.
//

#import "BaseViewController.h"

@interface BaseViewController ()

@end

@implementation BaseViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
   
    
    [self setNav];
    
    
    NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor], UITextAttributeTextColor,
                          [UIFont boldSystemFontOfSize:19],UITextAttributeFont,
                          nil];
    
    self.navigationController.navigationBar.titleTextAttributes = dict;
    
    [self setleftBarButtonItem:@"" orImaged:@"head-icon_04.png" Event:@selector(backToPreViewController)];

    
    
	// Do any additional setup after loading the view.
}

-(void)backToPreViewController{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}



-(void)setNav{
    //[TSMessage setDefaultViewController:[Router shared].navigationController];
    
    if([UINavigationBar instancesRespondToSelector:@selector(setShadowImage:)])
    {
        [[UINavigationBar appearance] setShadowImage:[UIImage new]];
    }
    
    UINavigationBar *navBar = self.navigationController.navigationBar;
    
    if ([navBar respondsToSelector:@selector(setBackgroundImage:forBarMetrics:)])
    {
        //if iOS 5.0 and later
        
        [navBar setBackgroundImage:[UIImage imageNamed:@"head-bg.png"] forBarMetrics:UIBarMetricsDefault];
    }
    
}

@end
